/**
 */
package Entityrelationship.entityrelationship.impl;

import Entityrelationship.entityrelationship.A_Composite;
import Entityrelationship.entityrelationship.Attribute_Composite;
import Entityrelationship.entityrelationship.EntityrelationshipPackage;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>AComposite</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Entityrelationship.entityrelationship.impl.A_CompositeImpl#getAttributes_composites <em>Attributes composites</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class A_CompositeImpl extends A_Composite_AlternativeIdentifierImpl implements A_Composite {
	/**
	 * The cached value of the '{@link #getAttributes_composites() <em>Attributes composites</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAttributes_composites()
	 * @generated
	 * @ordered
	 */
	protected EList<Attribute_Composite> attributes_composites;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected A_CompositeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return EntityrelationshipPackage.Literals.ACOMPOSITE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Attribute_Composite> getAttributes_composites() {
		if (attributes_composites == null) {
			attributes_composites = new EObjectContainmentEList<Attribute_Composite>(Attribute_Composite.class, this, EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES);
		}
		return attributes_composites;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES:
				return ((InternalEList<?>)getAttributes_composites()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES:
				return getAttributes_composites();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES:
				getAttributes_composites().clear();
				getAttributes_composites().addAll((Collection<? extends Attribute_Composite>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES:
				getAttributes_composites().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case EntityrelationshipPackage.ACOMPOSITE__ATTRIBUTES_COMPOSITES:
				return attributes_composites != null && !attributes_composites.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //A_CompositeImpl
